package lib;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;

public class Propertie extends Properties{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static Propertie propertieInstanz;
	public Propertie() throws IOException{
		String propertiepfad = Konstanten.PROPERTIENAME;
		BufferedInputStream stream = new BufferedInputStream(new FileInputStream(propertiepfad));
		load(stream);
		stream.close();
	}
	
	public static Propertie ladepropertieInstanz() throws InvalidFormatException, IOException {
		if (propertieInstanz == null) {
			propertieInstanz = new Propertie();
		}
		return propertieInstanz;
	}
	
	public String getPropertieEintrag(String eintrag){
	return getProperty(eintrag);
	}

	public static Propertie getPropertieInstanz() {
		return propertieInstanz;
	}

	public static void setPropertieInstanz(Propertie propertieInstanz) {
		Propertie.propertieInstanz = propertieInstanz;
	}
	
	
}
